import { createRouter, createWebHashHistory } from 'vue-router'
import Login from '../views/Login'

const routes = [
    {
        path: '/login',
        name: '登录',
        component: () => import('../views/Login')
    },
    {
        path: '/index',
        name: ' ',
        component: () => import('../views/Index'),
        children: [
            {
                path: '/form',
                name: '表单',
                meta: {
                    title: '表单'
                },
                component: () => import('../views/FormDemo')
            },

            {
                path: '/list',
                name: '列表',
                meta: {
                    title: '列表'
                },
                component: () => import('../views/TableDemo')
            }
        ]
    },
    {
        path: '/swipe',
        name:'SwipeMenuDemo',
        component: () => import('../views/SwipeMenuDemo')
    }

]

const router = createRouter({
    //history: createWebHashHistory(),
    history: createWebHashHistory(process.env.BASE_URL),
    routes
})

export default router